<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <table>
        <tr>
            <input type="button" value="添加" onclick="Install()">
            <input type="text" name="text">
            <input type="button" value="查找" onclick="Query()">
        </tr>
        <tr>
            <td>id</td>
            <td>标题</td>
            <td>摘要</td>
            <td>内容</td>
            <td>分类</td>
            <td>作者</td>
            <td>发表时间</td>
            <td>操作</td>
        </tr>
    </table>
    <script src="./js/jquery-3.6.0.min.js"></script>
    <script src="./js/init.js"></script>
    <script>
        $(function()
        {
            let tb=$('table')
            $.get(`http://127.0.0.1:8080/product`,function(res)
            {
                res.forEach(item => {
                    tb.append(
        `
        <tr>
            <td>${item.id}</td>
            <td>${item.biaoti}</td>
            <td>${item.zhayao}</td>
            <td>${item.neirong}</td>
            <td>${item.fenlei}</td>
            <td>${item.zuozhe}</td>
            <td>${item.shijian}</td>
            <td><input type="button" value="修改" onclick="Update(${item.id})"></td>
            <td><input type="button" value="删除" onclick="Delete(${item.id})"></td>
        </tr>

                        `)
                    
                    
                });
            })
        })
    </script>
</body>
</html>